<%@ page language="java" contentType="text/html; charset=utf-8"	pageEncoding="utf-8"%>
<!DOCTYPE html>
<HTML>
<HEAD>
	<TITLE> ZTREE DEMO - Simple Data</TITLE>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" href="../../resource/css/demo.css" type="text/css">
	<link rel="stylesheet" href="../../resource/css/zTreeStyle.css" type="text/css">
	<script type="text/javascript" src="../../resource/js/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="../../resource/js/jquery.ztree.core-3.2.js"></script>
	<SCRIPT type="text/javascript">
	    var pw=window.dialogArguments;   
		var setting = {
				data: {
					key: {
						title:"t"
					},
					simpleData: {
						enable: true
					}
				},
				callback: {
					onClick: onClick
				}
		};
		function onClick(event, treeId, treeNode, clickFlag) {
			window.opener.document.getElementById("paId").value=treeNode.id;
			window.opener.document.getElementById("pName").value=treeNode.name;
		}		
		$(document).ready(function(){
			$.ajax({
				url:"../../menu/queryTreeData.action",
				type:"GET",
				cache:false,
				async:false,
				error:function(json){
					 alert('Error loading XML document');
			         return false;
				},
				success:function(json){
					$.fn.zTree.init($("#treeDemo"), setting, eval(json.menuTree));
				}
			});
		});
	</SCRIPT>
 </HEAD>

<BODY>
	<ul id="treeDemo" class="ztree"></ul>
	<br/>
	<input type="submit" value="确定" onclick="window.close()">
</BODY>
</HTML>